package com.homework02;

import java.util.Scanner;

/*
键盘录入三个整数, 请求三个数中的最小值
*/
public class work04 {
    public static void main(String[] args) {
        int[] arr = new int[3];
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入三个整数比较大小:");
        for (int i = 0; i < 3; i++) {
            int a = sc.nextInt();
            arr[i] = a;
        }
        int min = arr[0];
        for (int j = 0; j < arr.length; j++) {
            if (min > arr[j]) {
                min = arr[j];
            }
        }
        System.out.println("最小值为:" + min);
    }
}
